<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %> 
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/viewOrder.do"/>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.sales.forms.ApproverOrderForm,
                 com.scalar.chiptrack.commons.Constants"%>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<script language="JavaScript">

    function openSalesOrder()
    {
        var temp = eval(document.approverOrderForm["salesOrder.salesOrderId"]);
        var salesOrderId = temp.value;
        newWindow = window.open('order.do?action=printOrder&salesOrderId='+salesOrderId,'optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=400,left=100,top=50,resizable=yes');
  	//newWindow.moveTo(100,50);
  	newWindow.focus();
    }

// SharatH on July 31, 2003
function showErrorReportPage()
{
    newWindow = window.open ('<%=chipTracContext%>/reportProblem.do','reportProblem','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=750,height=400,resizable=no');
    newWindow.focus();
}

</script>

<!-- Top Header Start-->
    <%
        String userTypeChiptrac = Constants.USER_TYPE_CHIPTRAC + "";
    %>
    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/header.jsp" %>
    </logic:equal>
    <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
        <%@ include file="/jsp/includes/extHeader.jsp" %>
    </logic:notEqual>

<!-- Top Header End-->
  
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigations start -->
<%
    String heading = "";
    if((request.getParameter("isSample") != null) && (request.getParameter("isSample").equals("0"))) {
    heading = "Sample Order ";
    %>
	    <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/sample_order_menu.jsp" %>
        </logic:equal>
        <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/ext_sample_order_menu.jsp" %>
        </logic:notEqual>
<% } else {
        heading = "Sales Order";
        %>
        <logic:equal value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/sales_order_menu.jsp" %>
        </logic:equal>
        <logic:notEqual value="<%=userTypeChiptrac%>" name="user" property="userType" scope="session">
            <%@ include file="/jsp/sales/ext_sales_order_menu.jsp" %>
        </logic:notEqual>
<% } %>


</TD>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<html:html>

<!-- from here your body starts -->
<html:form name="approverOrderForm" action="/approveOrder" method="post" type="com.scalar.chiptrack.sales.forms.ApproverOrderForm">


<center><span class="NArialW"><%=heading%> Details</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
   <nested:nest property="salesOrder">
   <table border="0" width="95%" align=right>
     <tr>
       <td width="20%"><font class="NArialL">Sales Order No :</font></td>
       <td width="21%" class="bodytext"><b><nested:write property="salesOrderNo" /></b>
            <nested:hidden property="salesOrderId" /></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL">Customer Name :</font></td>
       <td width="21%" class="bodytext"><nested:write property="customerName" /></td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="20%"><font class="NArialL">Customer PO No :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="customerPO"/></font></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL">Contact Person :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="contactPerson"/></font></td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="20%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoRevisionNumber"/> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="poRev"/></font></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL"><bean:message key="label.sales.salesOrder.PoDate"/> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="poDate"/></font></td>
       <td width="3%">&nbsp;</td>

     </tr>
     <tr>
       <td width="20%"><font class="NArialL">Phone :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="phoneNumber" /></td>
       <td width="3%">&nbsp;</td> 
       <td width="26%"><font class="NArialL">Cell No :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="cellNumber" /></td>
	   <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="20%"><font class="NArialL">Fax :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="faxNumber" /></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL">Email :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="email" /></td>
	   <td width="3%">&nbsp;</td>
	  
     </tr>
	  <tr><!-- Added by Sarada on 8th March 2004  -->
	  <td width="20%"><font class="NArialL">Sales Person :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesPerson" /></td>
       <td width="3%">&nbsp;</td> 
       <%--<td width="21%"><font class="NArialL">Sales Person</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesPerson" /></td> --%>
	   <td width="26%"><font class="NArialL"><bean:message key="label.sales.salesRep.Name"/> :</font></td>
       <td width="21%" class="bodytext"><nested:write  property="salesRep" /></td>
       <td width="3%">&nbsp;</td>
	 </tr>
     <tr>
       <td width="20%"><font class="NArialL"><bean:message key="label.sales.salesOrder.ShippingMethod" /> :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingMethod" /></font></td>
        <td width="3%">&nbsp;</td>
       <%--td width="21%"><font class="NArialL">Shipping Account :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingAccount" /></font></td--%>
       <td width="26%"><font class="NArialL">Regional Rep : </font></td>
       <td width="21%" class="bodytext"><nested:write name="salesOrderForm" property="regionalRep" />
       <td width="3%">&nbsp;</td>
     </tr>
    <tr>
       <td width="20%"><font class="NArialL"><bean:message key="label.sales.endUser"/> :</font></td>
       <td width="21%" class="bodytext"><nested:write name="salesOrderForm" property="endCustomer"  /></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL"><bean:message key="label.sales.shipToCustomer"/> :</font></td>
       <td width="21%" class="bodytext"><nested:write name="salesOrderForm" property="odm" />
        </td>
       <td width="3%">&nbsp;</td>
     </tr>
    <tr>
       <td width="20%"><font class="NArialL">Pay Terms :</font></td>
       <td width="21%" class="bodytext"><nested:write name="salesOrderForm" property="shippingTerms"  /></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL"><bean:message key="label.sales.salesOrder.DeliveryTerms" /> : </font></td>
       <td width="21%" class="bodytext">
            <nested:notEqual name="salesOrderForm" property="shippingTerms" value="-1" >
                <nested:write name="salesOrderForm" property="deliveryTerms" />
            </nested:notEqual>

        </td>
       <td width="3%">&nbsp;</td>
     </tr>
    <tr>
       <td width="20%"><font class="NArialL">Booking Date :</font></td>
       <td width='21%' class="bodytext"><nested:write name="salesOrderForm" property="salesOrderDate"/></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL">Quotation No :</font></td>
       <td width="21%" class="bodytext">
            <nested:notEqual value="null" name="salesOrderForm" property="quotationNo">
                <nested:write name="salesOrderForm" property="quotationNo" />
            </nested:notEqual>
       </td>
       <td width="3%">&nbsp;</td>
     </tr>
   <tr>
        <td width="21%"><font class="NArialL">&nbsp;</font></td>
        <td width="21%">&nbsp;</td>
        <td width="3%">&nbsp;</td>
        <nested:equal value="true" name="salesOrderForm" property="isConsignee">
        <td width="25%" class="NArialL">Invoice to Customer : </td>
            <td width="21%" class="bodytext">
                <nested:equal value="0" name="salesOrderForm" property="isConsignmentSales">No</nested:equal>
                <nested:notEqual value="0" name="salesOrderForm" property="isConsignmentSales">Yes</nested:notEqual>
            </td>
        </nested:equal>
        <nested:notEqual value="true" name="salesOrderForm" property="isConsignee">
            <td width="25%">&nbsp;</td>
            <td width="21%">&nbsp;</td>
        </nested:notEqual>
        <td width="3%">&nbsp;</td>
    </tr>
     <tr>
       <td width="20%" valign="top"><font class="NArialL">Billing Address :</font></td>
       <td width="21%" valign="top"><font class="bodytext">
        <!-- <nested:write property="billingAddress"/></font> -->
        <% ApproverOrderForm approveOrderForm = (ApproverOrderForm) request.getAttribute("approverOrderForm"); %>
        <%=approveOrderForm.getSalesOrder().getBillingAddressAsHTML()%>
        </td>
       <td width="3%">&nbsp;</td>
       <td width="26%" valign="top"><font class="NArialL">Shipping Address :</font></td>
       <td width="21%" valign="top"><font class="bodytext">
            <!-- <nested:write property="shippingAddress" /></font> -->
            <%=approveOrderForm.getSalesOrder().getShippingAddressAsHTML()%>
       </td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr><td colsapn=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
     <tr>
       <td width="20%"><font class="NArialL">Freight Instructions :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="freightInstructions" /></font></td>
       <td width="3%">&nbsp;</td>
       <td width="26%"><font class="NArialL">Shipping Instructions :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="shippingInstructions" /></font></td>
       <td width="3%">&nbsp;</td>
     </tr>
     <tr>
       <td width="20%"><font class="NArialL">Comments :</font></td>
       <td width="21%"><font class="bodytext"><nested:write property="comments" /></font></td>
       <td width="3%">&nbsp;</td>
       <td width="26%">&nbsp;</td>
       <td width="21%">&nbsp;</td>
       <td width="3%">&nbsp;</td>
     </tr>
     </nested:nest>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>    
     <tr><td colspan=6><chiptrack:info styleClass="NArialL" /></td></tr>          
     <%--<tr><td colspan=6><chiptrack:errors styleClass="NArialL" /></td></tr>  --%>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
     <tr><td colspan=6>
        <table border="0" width="100%" bordercolor="#FFFFFF">
	 <tr>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Line Item</font></td>
	   <td width="10%" align="center" bgcolor="#993333"><font class="NArialL">
		<!-- Modified by veeru on (03/05/04) 
                <font color="#FFFFFF">Mfg Part Number</font> -->
       <font color="#FFFFFF"><bean:message key="label.mfgPartNumber" /></font>
		
	   </td>
        <td width="10%" align="center" bgcolor="#993333"><font class="NArialL">
        <font color="#FFFFFF">
        <!-- Modified by veeru on (03/08/04)
        Customer PartNo -->
        <bean:message key="label.customerPartNumber"/>
        </font></td>
        <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
        <td width="10%" align="center" bgcolor="#993333"><font class="NArialL">
        <font color="#FFFFFF"><bean:message key="label.labelNumber"/>
        </font></td>
        <%}%>
           <!--<td width="10%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Description</font></td>-->
       <td width="1%" align=center bgcolor='#993333' class="NArialL">
            <font color="#FFFFFF">Taxable</td>
	   <td width="5%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Quantity</font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Price </font></td>
	   <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Amount</font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Req'd Dock Date</font></td>
           <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
                <font color="#FFFFFF">Schedule Date</font></td>
           <td width="20%" align="center" bgcolor="#993333"><font class="NArialL">
            <font color="#FFFFFF">Status</font></td>

         </tr>
        <%-- <logic:iterate id="LineItem" name="cancelledLineItems">--%>
         <logic:iterate id="myHashMap" name="cancelledLineItemsWithSubTotals" >
            <logic:iterate id="lineItemList" name="myHashMap" >
                <logic:iterate id="LineItem" name="lineItemList" property="key" type="com.scalar.chiptrack.sales.LineItem">
         <tr>
	        <td width="8%" bgcolor="#DEE1E2" align=center>
                <font class="NArialL"><bean:write name="LineItem" property="lineItemNo" /></font></td>
	        <td width="10%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="manufacturingPartNo" /></font></td>
            <td width="10%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="customerPartNo" /></font></td>
            <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
            <td width="10%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="labelNumber" /></font></td>
            <%}%>
            <!--<td width="10%" bgcolor="#DEE1E2">
            <font class="NArialL"><bean:write name="LineItem" property="lineItemDescription" /></font></td>-->
            <td width="1%" bgcolor="#DEE1E2" class="bodytext" align=center>
                <bean:write name="LineItem" property="isTaxableAsString"/></td>
	        <td width="5%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="qtyAsString" /></font></td>           
	        <td width="8%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="unitPriceAsString" /></font></td>
            <td width="8%" bgcolor="#DEE1E2" align=right>
                <font class="NArialL"><bean:write name="LineItem" property="amountAsString" /></font></td>
            <td width="8%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="requestDate" /></font></td>
            <td width="8%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="scheduleDate" /></font></td>
            <td width="20%" bgcolor="#DEE1E2">
                <font class="NArialL"><bean:write name="LineItem" property="status" /></font>
            </td>
         </tr>
         </logic:iterate>
         <tr>
            <%if(Constants.CLIENT_NAME_AIRGO.equalsIgnoreCase(ConfigManager.getClientNameAirgo() )){ %>
            <td colspan="5" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                Sub Total
            </td>
            <%}else{%>
            <td colspan="4" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                Sub Total
            </td>
            <%}%>
            <%-- Modified by Prabhanjan (3 Arp 2004) --%>
            <bean:define id="subTotal" name="lineItemList" property="value" type="com.scalar.chiptrack.sales.SubTotal"/>
            <td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                <bean:write name="subTotal" property="subTotalQty" />
            </td>
            <td>&nbsp;</td>
            <td colspan="1" width="15%" bgcolor="#FFFFFF" class="NArialL" align="right">
                <bean:write name="subTotal" property="subTotalAmt" />
            </td>
            <td>&nbsp</td>
            <td>&nbsp</td>
        </tr>
   </logic:iterate>
</logic:iterate>

        </table>
     </td>
     </tr>
     <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
     
    </table>

<input type="hidden" name="isSample" value="<%=request.getParameter("isSample")%>">
</html:form>
</html:html>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->

</BODY>
</HTML>
